import Vue from 'vue';
import VueRouter from 'vue-router';

// 配置文件
const $config = require("@/config");
// 路由
Vue.use(VueRouter);
const routes = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    name: 'Home',
    component: () => import('../views/home/HomeMain.vue'),
    children: []
  },
  {
    path: '/tenant',
    name: 'Tenant',
    component: () => import('../views/tenant/Tenant.vue')
  },
  {
    path: '/cinema',
    name: 'Cinema',
    component: () => import('../views/cinema/Cinema.vue')
  },
  {
    path: '/database',
    name: 'Database',
    component: () => import('../views/database/Database.vue')
  },
  {
    path: '/module',
    name: 'Module',
    component: () => import('../views/module/Module.vue')
  },
  {
    path: '/task',
    name: 'Task',
    component: () => import('../views/task/Task.vue')
  },
  {
    path: '/schedule',
    name: 'Schedule',
    component: () => import('../views/schedule/Schedule.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: $config.BASE_URL,
  routes
});

export default router;
